package com.ideyatech.allowancereceipts.util;

import java.math.BigDecimal;

public class VATUtil {
	
	private static final double VAT_DIVISOR = 9.33333333;

	public static BigDecimal getVat(BigDecimal grossAmount) {
		return grossAmount.divide(new BigDecimal(VAT_DIVISOR));
	}
	
	public static BigDecimal getVatableAmount(BigDecimal grossAmount) {
		return grossAmount.subtract(getVat(grossAmount));
	}
	
	public static double getVat(double grossAmount) {
		return grossAmount / VAT_DIVISOR;
	}

	public static double getVatableAmount(double grossAmount) {
		return grossAmount - getVat(grossAmount);
	}
	
}
